<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="name" value="北京" />
    <input type="text" id="name1" value="朝阳" />
    
    <button id="btn">传参</button>
    <script>
        var btn = document.getElementById('btn')
     
    
        btn.onclick = function(){
            var name = document.getElementById("name").value;
            var name1 = document.getElementById("name1").value;
            alert(name)
            alert(name1)
        }
      
    </script>
    
</body>
</html>